|
900719_FOCE : xFOCE - serial tools - configure minicom for raw binary transfers
This page last changed on Aug 16, 2012 by headley.
This is useful for transferring binary files using minicom, for example when installing boot loaders. ===================
#!/bin/sh INFILE=/dev/null OUTFILE=/dev/null while [ $# -gt 0 ]; do case "$1" in -i) shift INFILE="$1" ;; -o) shift OUTFILE="$1" ;; -h|--help) echo "$0 -i infile -o outfile" ;; *) INFILE="$1" esac shift done cat << EOF binary-xfer utility for minicom Sending file ${INFILE} to ${OUTFILE} EOF /usr/bin/pv --force -i 0.25 -B 128 ${INFILE} 2>&1 > ${OUTFILE} # Use the line below if you don't have pv! # /bin/cat ${INFILE} > ${OUTFILE} cat << EOF File transfer complete EOF sleep 1 Now go over to minicom and go to the configuration menu (via ESC-O), then "File transfer protocols". You can add a section there called "binary", point it at your file, and specify: Then leave the menu and save your options. Next time you send a file (via ESC-S), you should see "Binary" listed as an option. [my alternative version] #!/bin/sh INFILE=/dev/null OUTFILE=/dev/null VERBOSE="TRUE" while [ $# -gt 0 ]; do case "$1" in -i) shift INFILE="$1" ;; -o) shift OUTFILE="$1" ;; -q) VERBOSE="FALSE" ;; -h|--help) echo "$0 [-q] -i infile -o outfile" ;; *) INFILE="$1" esac shift done if [ ${VERBOSE} == "TRUE" ] then cat << EOF binary-xfer utility for minicom Sending file ${INFILE} to ${OUTFILE} EOF fi #/usr/bin/pv --force -i 0.25 -B 128 ${INFILE} 2>&1 > ${OUTFILE} # Use the line below if you don't have pv! /bin/cat ${INFILE} > ${OUTFILE} #cat << EOF if [ ${VERBOSE} == "TRUE" ] then File transfer complete EOF fi sleep 1 |
| Document generated by Confluence on Feb 03, 2026 14:29 |